package com.moss.cloud.log.controller;

import com.moss.cloud.common.core.constant.ServiceList;
import com.moss.cloud.common.core.model.Result;
import com.moss.cloud.log.model.param.LoginLogParam;
import com.moss.cloud.log.service.ILoginLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * 用户登录日志前端你控制器
 *
 * @author 瑾年
 * @date 2023年11月13日
 */
@Slf4j
@RestController
@RequestMapping(ServiceList.LOG + "/loginLog")
public class LoginLogController {
    private ILoginLogService loginLogService;

    public LoginLogController(ILoginLogService loginLogService) {
        this.loginLogService = loginLogService;
    }
    /**
     * 分页查询登录日志
     *
     * @param loginLogParam
     * @return
     */
    @PostMapping("/logPage")
    public Mono<Result<?>> logPage(@RequestBody LoginLogParam loginLogParam) {
        return Mono.just(Result.success(loginLogService.logPage(loginLogParam)));
    }
}
